package com.liyuci.core.exception;

/**
 * 异常状态码（也可以查看{@link org.springframework.http.HttpStatus}）
 * @author liyuci
 * @date 2018-02-07 21:15:14
 */
public enum ErrorCode {

	OK(200, "OK"),
    FAILURE(0, "服务器错误，请联系管理员"),

    BAD_REQUEST(400, "Bad Request"),
    UNAUTHORIZED(401, "Unauthorized"),
    FORBIDDEN(403, "Forbidden"),
    NOT_FOUND(404, "Not Found"),
    METHOD_NOT_ALLOWED(405, "Method Not Allowed"),

    INTERNAL_SERVER_ERROR(500, "Internal Server Error"),
    INVALID_PARAM(100, "参数错误"),
    UNSUPPORT_IMAGE_TYPE(110, "不支持的图片格式"),
    UNSUPPORT_STORE_PATH(111, "找不到文件"),;

	ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    private final int code;

    private final String message;

    public int getCode() {
        return this.code;
    }

    public String getMessage() {
        return this.message;
    }
}
